//
//  def_program.h
//  compilation
//
//  Created by Kevin Le perf on 17/01/12.
//  Copyright (c) 2012 e2co technologie. All rights reserved.
//

#ifndef compilation_def_program_h
#define compilation_def_program_h
/*
 
 program
 : external_declaration {printf("program\n");}
 | program external_declaration {printf("program\n");}
 ; 
 */

struct def_program{
	void * parent;
	int type;
	struct def_external_declaration * external_declaration;
	struct def_program * program;
};

struct def_program * program_create(void * parent){
	struct def_program * p = malloc(sizeof(*p));
	p->type = 0;
	p->parent = parent;
	return p;
}

void program_print(struct def_program * p){
	switch(p->type){
		case 2:
			program_print(p->program);
		case 1:
			external_declaration_print(p->external_declaration);
			break;
	}
}
#endif
